package com.xiaowenxiong.service;

import com.xiaowenxiong.dao.CourseMapper;
import com.xiaowenxiong.entity.Course;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 15c on 2017/4/26.
 */
@Service("Course")
public class CouseServiceImpl implements CourseService{
    @Autowired
    CourseMapper courseMapper;
    @Override
    public Course selectAcourseInfo(Integer cno) {
        return courseMapper.selectByPrimaryKey(cno);
    }

    @Override
    public List<Course> selectNotCourse(String sno) {
        return courseMapper.selectNotChoosedCourse(sno);
    }

    @Override
    public List<Course> selectAllCoursesInfo() {
        return courseMapper.selectAllCourses();
    }

    @Override
    public int updateCourseInfo(Course course) {
        return courseMapper.updateByPrimaryKeySelective(course);
    }

    @Override
    public int insertNewCourse(Course course) {
        return courseMapper.insertSelective(course);
    }
}
